'use strict';
var calculate_median = function(collection){
    let median;
    if(collection.length%2==0)
        {   
            let a=collection[collection.length/2-1];
            let b=collection[collection.length/2];
            median=(a+b)/2;
        }
    else
        {
            median=collection[(collection.length+1)/2-1];
        }
    median=Math.ceil(median);
    return median;
};
module.exports = calculate_median;
